$.tablesorter.addParser({
  id: 'na_fix',
  type: 'numeric',
  is: function(s) {return false},
  format: function(data) {return data == 'NA' ? 0 : data;}
});

$.tablesorter.addParser({
  id: 'name',
  type: 'text',
  is: function(s) {return false},
  format: function(data) {
    name = data.split('&nbsp;');
    return name[1] + name[0];
  }
});

$(document).ready(function() {
  $.each(data, function() {
    row = $('<tr />')
    $.each($(this), function() {
      row.append($('<td />', {html: this + ''}))
    })
    $('#data tbody').append(row);
  });

  $('#data').tablesorter({
    widgets: ['zebra'],
    sortList: [[5, 1]],
    headers: {
      0: {sorter: 'name'},
      1: {sorter: 'usLongDate'},
      4: {sorter: 'na_fix'},
      5: {sorter: 'na_fix'},
      6: {sorter: 'na_fix'}
    },
    textExtraction: function(cell) {return cell.innerHTML;}
  });
});